package com.cn.wanxi.service;

import com.cn.wanxi.model.NewsModel;

import java.util.ArrayList;
import java.util.List;

public class NewsService {
    /**
     * 得到网站首页的较新动态新闻数据
     * @return
     */
    public List<NewsModel> getNewsListForHome() {
        List<NewsModel> list=new ArrayList<>();
        NewsModel model=new NewsModel();
        String [] titles=model.getTitles();
        String contents []=model.getContents();
        for(int i=0;i<titles.length;i++){
            NewsModel newsModel=new NewsModel();
            newsModel.setTitle(titles[i]);
            newsModel.setContent(contents[i]);
            list.add(newsModel);
        }
        return list;
    }
}
